<template>
  <div>
    <div class="layui-col-sm12 layui-col-md24">
      <div class="blog-card shadow">
        <div class="blog-card-title">PPT模板下载</div>
        <ul class="blog-card-ul">
          <li v-for="(item, index) in data" :key="index">
            <span class="layui-badge  ">荐</span>
            <router-link :to="'/news/down?id='+item.id" :title="item.title">{{item.title}}</router-link>
   
          </li>

        </ul>
      </div>
    </div>
  </div>
</template>
<script lang="ts">
export default {
  name: 'music'

}
</script>
<script lang="ts" setup>
import { ref } from 'vue';
import http from 'webosutils/lib/http';
import { useAppStore } from '../../store/app';
const appStore = useAppStore();
const data = ref([]) as any;

const GetRandomNew = () => {
  if (appStore.pptdata.length == 0) {
    http.post("/v1/api/portalsite/GetNew", { type: "B82AB160-7C17-4124-94FE-892F8B390DB8", limit: 15, page: 1 }).then(res => {
      data.value = Object.freeze( res.data);
      appStore.pptdata = data.value;
    }).catch(res => {

    });
  } else {
    data.value = appStore.pptdata;
  }
}
GetRandomNew();
</script>